/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jkoa.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "latihan")
@NamedQueries({
    @NamedQuery(name = "Latihan.findAll", query = "SELECT p FROM Latihan p")})
public class Latihan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_latihan")
    private Integer idLatihan;
    @Column(name = "nama_kursus")
    private String namaKursus;
    @ManyToOne
    @JoinColumn(name = "id_majikan")
    private Majikan majikan;
    @Column(name = "trh_mula")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhMula;
    @Column(name = "trh_akhir")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhAkhir;
     @Column(name = "skop_kerja")
    private String skopKerja;
       @Column(name = "anggaran_gaji")
    private String anggaranGaji;
     @ManyToOne
    @JoinColumn(name = "dimasuk")
    private Pengguna dimasukOleh;
    @Basic(optional = false)
    @Column(name = "trh_masuk")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhMasuk;
    @Column(name = "dikkini")
    private String dikkini;
    @Column(name = "trh_kkini")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhKkini;

    public Latihan() {
    }

    public Latihan(Integer idLatihan) {
        this.idLatihan = idLatihan;
    }

    public Latihan(Integer idLatihan, Pengguna dimasukOleh, Date trhMasuk) {
        this.idLatihan = idLatihan;
        this.dimasukOleh = dimasukOleh;
        this.trhMasuk = trhMasuk;
    }

    public String getAnggaranGaji() {
        return anggaranGaji;
    }

    public void setAnggaranGaji(String anggaranGaji) {
        this.anggaranGaji = anggaranGaji;
    }

    public Pengguna getDimasukOleh() {
        return dimasukOleh;
    }

    public void setDimasukOleh(Pengguna dimasukOleh) {
        this.dimasukOleh = dimasukOleh;
    }

    public Integer getIdLatihan() {
        return idLatihan;
    }

    public void setIdLatihan(Integer idLatihan) {
        this.idLatihan = idLatihan;
    }

    public Majikan getMajikan() {
        return majikan;
    }

    public void setMajikan(Majikan majikan) {
        this.majikan = majikan;
    }

    public String getNamaKursus() {
        return namaKursus;
    }

    public void setNamaKursus(String namaKursus) {
        this.namaKursus = namaKursus;
    }

    public String getSkopKerja() {
        return skopKerja;
    }

    public void setSkopKerja(String skopKerja) {
        this.skopKerja = skopKerja;
    }

    public Date getTrhMula() {
        return trhMula;
    }

    public void setTrhMula(Date trhMula) {
        this.trhMula = trhMula;
    }

    public Date getTrhAkhir() {
        return trhAkhir;
    }

    public void setTrhAkhir(Date trhAkhir) {
        this.trhAkhir = trhAkhir;
    }
  
    public Date getTrhMasuk() {
        return trhMasuk;
    }

    public void setTrhMasuk(Date trhMasuk) {
        this.trhMasuk = trhMasuk;
    }

    public String getDikkini() {
        return dikkini;
    }

    public void setDikkini(String dikkini) {
        this.dikkini = dikkini;
    }

    public Date getTrhKkini() {
        return trhKkini;
    }

    public void setTrhKkini(Date trhKkini) {
        this.trhKkini = trhKkini;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLatihan != null ? idLatihan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Latihan)) {
            return false;
        }
        Latihan other = (Latihan) object;
        if ((this.idLatihan == null && other.idLatihan != null) || (this.idLatihan != null && !this.idLatihan.equals(other.idLatihan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jkoa.model.Latihan[ idLatihan=" + idLatihan + " ]";
    }
    
}
